from problems import knobloch1, knobloch2
from solvers import galerkin, supg, crosswind, codina, docarmo 

# problem definitions
problem1 = knobloch1.Knobloch1()
problem2 = knobloch2.Knobloch2()
problems = [problem1, problem2]

# stabilizations
import stabilizations.supg
import stabilizations.crosswind

ga = galerkin.Galerkin()    # galerkin solver;
su = supg.Supg()            # supg solver;
cr = crosswind.Crosswind()  # crosswind solver; 
co = codina.Codina()        # codina solver
do = docarmo.doCarmo()      # do carmo solver

solver = do
for problem in problems:
    try:
        solver.solve(problem)                                                                                       # for galerkin
    except TypeError:
        try:
            solver.solve(problem,get_tau=stabilizations.supg.get_tau)                                               # for supg, crosswind, do Carmo
        except TypeError:
            solver.solve(problem,get_tau=stabilizations.supg.get_tau,get_sigma=stabilizations.crosswind.get_sigma)  # for Codina
